package io.github.uicdb.badskill.clent.impl;

import net.minecraft.network.chat.Component;
import net.minecraftforge.client.gui.widget.ExtendedButton;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

public class LearnButton extends ExtendedButton {
    private final Supplier<Component> msgGetter;

    public LearnButton(int xPos, int yPos, int width, int height, Supplier<Component> msgGetter, OnPress handler) {
        super(xPos, yPos, width, height, Component.literal("learn"), handler);
        this.msgGetter = msgGetter;
    }

    @Override
    public @NotNull Component getMessage() {
        return msgGetter.get();
    }
}
